<?php echo link_to('жагсаалт', 'testimonial/index', array('class'=>'title'))?> 
<span class="separator"> | </span>
<?php echo link_to('шинээр нэмэх', 'testimonial/new', array('class'=>'title'))?>
<br clear="all">
<br clear="all">

<form action="<?php echo url_for('testimonial/index')?>" method="GET">
    <fieldset>
        <legend>Хайлт / Шүүлт</legend>
        <b>Цэс: </b>
        <select id="menu" name="menu" style="width:200px;">
          <option value="all"></option>
          <?php $menus = myConstants::getMenus();?>
          <?php foreach ($menus as $key=>$value):?>
              <option <?php if ($sf_params->get('menu') == $key) echo 'selected';?> value="<?php echo $key?>"><?php echo $value?></option>
          <?php endforeach?>
        </select>
        
        <input type="submit" value="Харуулах" />
    </fieldset>
</form>

<table width="100%">
  <thead>
    <tr>
      <th>#</th>
      <th>Цэс</th>
      <th>Сэтгэгдэл</th>
      <th>Огноо</th>
      <th>#</th>
    </tr>
  </thead>
  <tbody>
    <?php $i=0; foreach ($pager->getResults() as $testimonial): ?>
    <tr>
      <td><?php echo ++$i?></td>
      <td><?php echo myConstants::getMenuValueByKey($testimonial->getMenu()) ?></td>
      <td>
        <?php echo $testimonial->getText() ?>
        <br><hr/>
        <?php echo $testimonial->getTextEn() ?>
      </td>
      <td>
        <?php echo $testimonial->getDate() ?>
        <br><hr/>
        <?php echo $testimonial->getDateEn() ?>
      </td>      
      <td nowrap>
        <a href="<?php echo url_for('testimonial/edit?id='.$testimonial->getId()) ?>">Засварлах</a><br><br>
        <a onclick="return confirm('Та итгэлтэй байна уу?')" href="<?php echo url_for('testimonial/delete?id='.$testimonial->getId()) ?>">Устгах</a>
      </td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
<?php echo pager($pager, 'testimonial/index')?>